import type { FC } from 'react';
import AiChatRobot from '@/components/AiChatRobot';
import { useToken } from '@/hooks/useSession';
import styles from './styles.module.less';

const Main: FC = () => {
  let [token, loading] = useToken();

  if (loading) {
    return null;
  }

  token = 'eyJraWQiOiJyUmhLMlhzWm5hNkZjR09za1UxUFNOK3FvUHY5YnRUS2tDRTBxOGJSRDhBPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI0ZDhiYTYzZC00OGQ1LTQ5MTctODY2NC03ZDNlNmI1NmNkMjAiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfR012VWhheFJzIiwiY29nbml0bzp1c2VybmFtZSI6ImpuZ0BpbmdyZWRpZW50c29ubGluZS5jb20iLCJpc19hZG1pbiI6IjEiLCJhdWQiOiJldDNpMXRwYmJtYjQxZW9ncmRscDVxY3NqIiwiZXZlbnRfaWQiOiIyMjIxOGEyZS0yODQ4LTQ4MTMtODZiMC1lZTkyYjBiYzE3NWMiLCJ1c2VyX2lkIjoiMTE4IiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE3MzQ0MDEwMTUsImZyb20iOiJzczMiLCJleHAiOjE3MzQ0NzMwMTQsImlhdCI6MTczNDQwMTAxNSwiZW1haWwiOiJqbmdAaW5ncmVkaWVudHNvbmxpbmUuY29tIn0.J00iT2KC1pYZ0_eglN9S6WRUTmEE7uQPN7exEkOEl_X9eR5EL7048Ea5Imhqt8s-0FUBfKvmrOWPdltGdIplta-IHww2HP8opJVEveXslTe7Sreew8l8qu_y3eZg9_NigWkYsCTKvnUFAv-f_BGiY2PfVH-WAXuhzmAKI9mvjRim6egWwGwhSNYo9ETVfP3kd4OGGhasmXR-LFXwlsD-hproHNXt1mwrh4z6pnb2BhzNGPqLTkzU2oq8-Mvq11Lz8AtCrjJqKBWQUiqXLFC7gFjDXHiVFXbJx2lA-WxZBRr9LYp932cOlXuzpC48499ZOonpXeOEHsj-mhmTjFqrPg'

  return (
    <div className={styles.container}>
      <AiChatRobot token={token} />
    </div>
  );
}

export default Main;